package lec10api2;

import java.util.Arrays;

public class RadixSort {
    public static void main(String[] args) {
        int[] a = new int[]{1, 1, 6, 3, 3};
        int[] b = new int[10];
        for (int i : a) {
            b[i]++;
        }
        System.out.println(Arrays.toString(b));

        for (int i = 0; i < b.length; i++) {
            if (b[i] != 0) {
                System.out.print(i + " ");
            }
        }
        System.out.println();
        for (int i = 0; i < b.length; i++) {
            for (int j = 0; j < b[i]; j++) {
                System.out.print(i + " ");
            }
        }
        System.out.println();
    }
}
